import Category from '@renderer/pages/Category'
import CategoryAction from '@renderer/pages/Category/CategoryAction'
import CategoryLoader from '@renderer/pages/Category/CategoryLoader'
import Content from '@renderer/pages/Content'
import ContentAction from '@renderer/pages/Content/ContentAction'
import ContentLoader from '@renderer/pages/Content/ContentLoader'
import ContentList from '@renderer/pages/ContentList'
import ContentListAction from '@renderer/pages/ContentList/ContentListAction'
import ContentListLoader from '@renderer/pages/ContentList/ContentListLoader'
import Config from '@renderer/pages/layout/Config/index'
import Home from '@renderer/pages/layout/Home'
import Settting from '@renderer/pages/Setting'
// import SettingAction from '@renderer/pages/Setting/SettingAction'
// import SettingLoader from '@renderer/pages/Setting/SettingLoader'
import Welcome from '@renderer/pages/Welcome'
import { createHashRouter } from 'react-router-dom'

const router = createHashRouter([
  { path: '/', element: <Home></Home> },
  {
    path: '/config',
    element: <Config></Config>,
    children: [
      {
        index: true,
        // action: SettingAction,
        // loader: SettingLoader,
        element: <Settting></Settting>,
      },
      {
        path: 'category',
        element: <Category></Category>,
        loader: CategoryLoader,
        action: CategoryAction,
        children: [
          {
            path: 'contentList/:cid?',
            element: <ContentList></ContentList>,
            loader: ContentListLoader,
            action: ContentListAction,
            children: [
              {
                index: true,
                element: <Welcome></Welcome>,
              },
              {
                path: 'content/:id',
                loader: ContentLoader,
                action: ContentAction,
                element: <Content></Content>,
              },
            ],
          },
        ],
      },
    ],
  },
])
export default router
